package threading;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: Microsoft
 * Date: 2023-07-09
 * Time: 10:33
 */
public class ThreadDemo15 {
    public static void main(String[] args) throws InterruptedException {
        Object object = new Object();
        System.out.println("wait 之前");
        synchronized (object) {//我们加锁的锁对象要和调用wait的对象一致
            object.wait();//要抛出异常
        }

        System.out.println("wait 之后");
    }
}
